{tpl head}
<script charset="utf-8" src="kedit/kindeditor-min.js"></script>
<script type="text/javascript">
    var editor;
    KindEditor.ready(function(K) {
        editor = K.create('textarea[name="content"]', {uploadJson: 'kdupload.php?yeslitpic=1',filterMode:false,width:'99%',height:'500px'});
        //给按钮添加click事件
    });
    $(function(){
        $(".nav a").click(function(){
            $(this).addClass("current").siblings().removeClass("current");
            $(".new_table").eq($(this).index()).removeClass("hidden").siblings(".new_table").addClass("hidden");

        });
        $("#set").click(function(){
            $(".hidden").show("slow");
        });
    });
</script>

<script language="javascript" type="text/javascript" src="{$skin}js/My97DatePicker/WdatePicker.js"></script>

<form method="Post" action="?c={$classname}" name="k_form">
    <table class="new_table" width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
        <thead><tr class="n_bt"><td colspan="5" align="center">工作小助手管理系统</td></tr>
        <tr><th height="28" colspan="2" class="thbt">【{$title}】</th></tr>
        </thead>
        <tbody>
        <tr>
            <td width="13%" height="30" align="right">三级单位：</td>
            <td width="87%">
                <select name="post[company_id]">
                    {loop $list_company $k $v}
                    <option value="{$v.id}" {if $v.id==$oj.company_id}selected{/if}>{$v.name}</option>
                    {/loop}
                </select> <span class="red">*</span></td>
        </tr>
        <tr>
            <td width="13%" height="30" align="right">设备类型：</td>
            <td width="87%">
                <select name="post[type_id]" id="type_id">
                    {loop $list_type $k $v}
                    <option value="{$v.id}" {if $v.id==$oj.type_id}selected{/if}>{$v.name}</option>
                    {/loop}
                </select> <span class="red">*</span></td>
        </tr>
        <tr>
            <td height="30" align="right">设备名称：</td>
            <td><input name="post[name]" type="text" value="{$oj.name}" class="input400" /></td>
        </tr>
        <tr>
            <td width="13%" height="30" align="right">品牌：</td>
            <td width="87%">
                <select name="post[brand_id]">
                    {loop $list_brand $k $v}
                    <option value="{$v.id}" {if $v.id==$oj.brand_id}selected{/if}>{$v.name}</option>
                    {/loop}
                </select> <span class="red">*</span></td>
        </tr>
        <tr>
            <td width="13%" height="30" align="right">设备状态：</td>
            <td width="87%">
                <select name="post[status_id]">
                    {loop $list_status $k $v}
                    <option value="{$v.id}" {if $v.id==$oj.status_id}selected{/if}>{$v.name}</option>
                    {/loop}
                </select> <span class="red">*</span></td>
        </tr>
        <tr>
            <td width="13%" height="30" align="right">产权归属：</td>
            <td width="87%">
                <select name="post[cq_id]">
                    {loop $list_cq $k $v}
                    <option value="{$v.id}" {if $v.id==$oj.cq_id}selected{/if}>{$v.name}</option>
                    {/loop}
                </select> <span class="red">*</span></td>
        </tr>
        <tr>
            <td height="30" align="right"><p>型号：</p></td>
            <td><input name="post[model]" type="text" value="{$oj.model}" class="input400" /></td>
        </tr>
        <tr>
            <td height="30" align="right"><p>出厂编号：</p></td>
            <td><input name="post[product_no]" type="text" value="{$oj.product_no}" class="input400" /></td>
        </tr>
        <tr>
            <td height="30" align="right"><p>出厂日期：</p></td>
            <td><input name="post[product_date]" onClick="WdatePicker()" type="text" value="{if $oj.product_date}{function=date('Y-m-d',$oj.product_date)}{/if}" class="input400" /></td>
        </tr>
        <tr>
            <td height="30" align="right"><p>存放地点：</p></td>
            <td><input name="post[location]" type="text" value="{$oj.location}" class="input400" /></td>
        </tr>
        <tr>
            <td height="30" align="right"><p>领用部门：</p></td>
            <td><input name="post[use_department]" type="text" value="{$oj.use_department}" class="input400" /></td>
        </tr>
        <tr>
            <td height="30" align="right"><p>领用人：</p></td>
            <td><input name="post[use_user_name]" type="text" value="{$oj.use_user_name}" class="input400" /></td>
        </tr>
        <tr>
            <td height="30" align="right"><p>领用日期：</p></td>
            <td><input name="post[use_date]" type="text" onClick="WdatePicker()" value="{if $oj.use_date}{function=date('Y-m-d',$oj.use_date)}{/if}" class="input400" /></td>
        </tr>
        <tr>
            <td height="30" align="right"><p>负责人：</p></td>
            <td><input name="post[person_id]" type="text" value="{$oj.person}" class="input400" /></td>
        </tr>
        <tr id="ip">
            <td height="30" align="right"><p>IP：</p></td>
            <td><input name="post[ip]" type="text" value="{$oj.ip}" class="input400" /></td>
        </tr>
<tbody id="new">{$field}</tbody>
        <tr>
            <td height="30" align="right">备注：</td>
            <td class="pb5"><textarea name="contents" class="input400 textareah" cols="95" rows="20" >{$oj.con}</textarea></td>
        </tr>
        <tr>
            <td height="35" colspan="2" align="center" ><input name="into_wz" id="submit" class="button" type="submit" value="{$submit}" />
                &nbsp;<input name="post[" type="reset" class="button" value="重置" />
                <input name="id" type="hidden" value="{$oj.id}" />
                <input type="hidden" name="a" value="{$form_action}" />

            </td>
        </tr>
</tbody>
        </table>
</form>
<script type="text/javascript">
    $(function(){
       $("#type_id").change(function(){
           var tid=$(this).val();
           var html= $.get('?c=device&a=ajax_fields&id='+tid,function(data){
               $("#new").html(data);
           })
       });
    })
</script>
{tpl foot}